home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / BrainE.lha / BrainE! next >
Text File  |  1996-11-29  |  20KB  |  550 lines

  1. /*************************************************************************/
  2. /*             BrainE! v1.0 for Excelsior! BBS  by Morpheus              */
  3. /*************************************************************************/
  4. path='Doors:BrainE!/'
  5. /*************************************************************************/
  6. options results
  7. temp=right(path,1)
  8. if temp~='/'&temp~=':' then path=path||'/'
  9. bbsidentify term
  10. maxlines=word(result,2)
  11. if maxlines<30 then setlength 30
  12. bbsidentify SYSOP
  13. sysop=result
  14. tr=transmit
  15. sn=sendstring
  16. gc=getchar
  17. cp5=copies(' ',5)
  18. cp12=copies(' ',12)
  19. cp15=copies(' ',15)
  20. cp25=copies(' ',25)
  21. level=1
  22. x_tot=4
  23. y_tot=3
  24. totaal=12
  25. call read_hiscore(1)
  26. call show_header
  27. choice=0
  28. do while choice~=4
  29. call show_main
  30. call check_carrier
  31. gc
  32. choice=result
  33. sn choice
  34. select
  35. when choice=0 then call new_game
  36. when choice=1 then call show_instr
  37. when choice=2 then;do
  38. call show_hiscore
  39. sn cp25||'Press \c2<\c3Enter\c2> \c3to continue! '
  40. call check_carrier
  41. gc
  42. end
  43. when choice=3 then call change_level
  44. otherwise nop
  45. end
  46. end
  47. call quit_game
  48. exit
  49. new_game:
  50. do while invoer~='M'
  51. invoer='R'
  52. cont=1
  53. call clr(9)
  54. sn '1H'||cp15||'   \c3Please wait... Setting up a new game: \c7'
  55. call gen_veld
  56. sn '\c2Done!\w1'
  57. do while cont=1
  58. if invoer='R' then;do
  59. call show_veld
  60. do i=1 for totaal
  61. input.i=0
  62. end
  63. move=0
  64. time('R')
  65. end
  66. call check_carrier
  67. gc
  68. invoer=result
  69. if invoer='1B'x then;do
  70. checkio
  71. if result='TRUE' then;do
  72. gc;gc
  73. invoer=result
  74. if invoer='A' then invoer='8'
  75. if invoer='B' then invoer='2'
  76. if invoer='C' then invoer='6'
  77. if invoer='D' then invoer='4'
  78. end
  79. else invoer='M'
  80. end
  81. else if invoer='D'x|invoer='5'|invoer=' ' then invoer='0'
  82. else invoer=upper(invoer)
  83. select
  84. when invoer='C' then;do
  85. call change_level
  86. cont=0
  87. end
  88. when invoer='N' then cont=0
  89. when invoer='Q' then call quit_game
  90. when invoer='M' then cont=0
  91. when invoer='0' then;do
  92. if input.nr=0 then;do
  93. move=move+1
  94. input.nr=1
  95. sn apos(y+1,x+1)||col(input.nr)
  96. if nr>x_tot then;do
  97. temp=nr-x_tot
  98. if input.temp>0 then;do
  99. input.temp=1+(input.temp//4)
  100. sn apos(y-3,x+1)||col(input.temp)
  101. end
  102. end
  103. if nr<=(totaal-x_tot) then;do
  104. temp=nr+x_tot
  105. if input.temp>0 then;do
  106. input.temp=1+(input.temp//4)
  107. sn apos(y+5,x+1)||col(input.temp)
  108. end
  109. end
  110. if (nr//x_tot)~=1 then;do
  111. temp=nr-1
  112. if input.temp>0 then;do
  113. input.temp=1+(input.temp//4)
  114. sn apos(y+1,x-3)||col(input.temp)
  115. end
  116. end
  117. if (nr//x_tot)~=0 then;do
  118. temp=nr+1
  119. if input.temp>0 then;do
  120. input.temp=1+(input.temp//4)
  121. sn apos(y+1,x+5)||col(input.temp)
  122. end
  123. end
  124. end
  125. end
  126. when invoer='8' then;do
  127. if y>11 then;do
  128. sn cursor(y,x,7)
  129. y=y-4
  130. sn cursor(y,x,3)
  131. nr=nr-x_tot
  132. end
  133. end
  134. when invoer='2' then;do
  135. if y<(11+(y_tot-1)*4) then;do
  136. sn cursor(y,x,7)
  137. y=y+4
  138. sn cursor(y,x,3)
  139. nr=nr+x_tot
  140. end
  141. end
  142. when invoer='4' then;do
  143. if x>45 then;do
  144. sn cursor(y,x,7)
  145. x=x-4
  146. sn cursor(y,x,3)
  147. nr=nr-1
  148. end
  149. end
  150. when invoer='6' then;do
  151. if x<(45+(x_tot-1)*4) then;do
  152. sn cursor(y,x,7)
  153. x=x+4
  154. sn cursor(y,x,3)
  155. nr=nr+1
  156. end
  157. end
  158. otherwise nop
  159. end
  160. sn apos(8,49)
  161. if move=totaal then;do
  162. sn cursor(y,x,7)||'\w1'
  163. i=1
  164. correct=1
  165. do while i<=totaal
  166. if input.i~=veld.i then correct=0
  167. i=i+1
  168. end
  169. if correct=1 then;do
  170. score=time('E')
  171. score=delstr(score,length(score)-2,3)
  172. if score<10 then score=10
  173. if score>999 then score=999
  174. cont=0
  175. if length(score)=2 then string1=' º        \c7in '||score||' seconds!        \c3º '
  176. else string1=' º       \c7in '||score||' seconds!!       \c3º '
  177. if score<score.10 then string2=' º  \c7You have a top ten score!!  \c3º '
  178. else string2=' º     \c7Sorry, no highscore!     \c3º '
  179. tr apos(14,22)||copies(' ',34)
  180. tr apos(15,22)||' \c3ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» '
  181. tr apos(16,22)||' º                              º '
  182. tr apos(17,22)||' º       \c7YES! You did it!       \c3º '
  183. tr apos(18,22)||' º                              º '
  184. tr apos(19,22)||' º  \c7You have solved the puzzle  \c3º '
  185. tr apos(20,22)||' º                              º '
  186. tr apos(21,22)||string1
  187. tr apos(22,22)||' º                              º '
  188. tr apos(23,22)||string2
  189. tr apos(24,22)||' º                              º '
  190. tr apos(25,22)||' ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ '
  191. tr apos(26,22)||copies(' ',34)
  192. call clr(27)
  193. sn '\n1'||cp25||'Press \c2<\c3Enter\c2> \c3to continue! '
  194. if score<score.10 then;do
  195. call write_hiscore
  196. call check_carrier
  197. gc
  198. new_hiscore=1
  199. call show_hiscore
  200. new_hiscore=0
  201. sn cp25||'Press \c2<\c3Enter\c2> \c3to continue! '
  202. end
  203. end
  204. else;do
  205. tr apos(14,21)||copies(' ',37)
  206. tr apos(15,21)||' \c3ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» '
  207. tr apos(16,21)||' º                                 º '
  208. tr apos(17,21)||' º    \c7Sorry, you did NOT solve     \c3º '
  209. tr apos(18,21)||' º                                 º '
  210. tr apos(19,21)||' º           \c7the puzzle!!          \c3º '
  211. tr apos(20,21)||' º                                 º '
  212. tr apos(21,21)||' º  \c7Press \c3<\c7R\c3> \c7to retry this game,  \c3º '
  213. tr apos(22,21)||' º                                 º '
  214. tr apos(23,21)||' º   \c7or \c3<\c7N\c3> \c7to start a new game.   \c3º '
  215. tr apos(24,21)||' º                                 º '
  216. tr apos(25,21)||' ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ '
  217. tr apos(26,21)||copies(' ',37)
  218. sn apos(8,49)
  219. end
  220. call check_carrier
  221. gc
  222. temp=upper(result)
  223. select
  224. when temp='Q' then call quit_game
  225. when temp='M' then;do
  226. invoer='M'
  227. cont=0
  228. end
  229. when temp='R'&cont=1 then invoer='R'
  230. when temp='C' then;do
  231. call change_level
  232. cont=0
  233. end
  234. otherwise cont=0
  235. end
  236. end
  237. end
  238. end
  239. invoer=0
  240. return
  241. read_hiscore:
  242. if ~open('HiScore',path||'BrainE!_'||arg(1)||'.data','R') then;do
  243. if ~open('HiScore',path||'BrainE!_'||arg(1)||'.data','W') then;do
  244. call clr(1)
  245. tr '\c7Error: Could not create new highscore file for level '||arg(1)||'!'
  246. tr '       Please notify the sysop.\w5'
  247. call quit_game
  248. end
  249. do i=1 for 10
  250. alias.i=sysop
  251. writeln('HiScore',alias.i)
  252. score.i=989+i
  253. writeln('HiScore',score.i)
  254. end
  255. close('HiScore')
  256. end
  257. else;do
  258. do i=1 for 10
  259. alias.i=readln('HiScore')
  260. score.i=readln('HiScore')
  261. end
  262. close('HiScore')
  263. end
  264. return
  265. write_hiscore:
  266. i=1
  267. do while i<=10
  268. if score<score.i then;do
  269. j=10
  270. do while j>i
  271. k=j-1
  272. score.j=score.k
  273. alias.j=alias.k
  274. j=j-1
  275. end
  276. score.i=score
  277. getuser 1
  278. alias.i=result
  279. player=i
  280. i=10
  281. end
  282. i=i+1
  283. end
  284. if ~open('HiScore',path||'BrainE!_'||level||'.data','W') then;do
  285. call clr(1)
  286. tr '\c7Error: Could not write to highscore file of level '||level||'!'
  287. tr '       Please notify the sysop.\w5'
  288. call quit_game
  289. end
  290. do i=1 for 10
  291. writeln('HiScore',alias.i)
  292. writeln('HiScore',score.i)
  293. end
  294. close('HiScore')
  295. return
  296. show_veld:
  297. call clr(9)
  298. y=11
  299. x=45
  300. nr=1
  301. select
  302. when level=1 then;do
  303. tr '1H'||cp15||' \c2ÉÍÍÍËÍÍÍËÍÍÍËÍÍÍ»          \c4ÉÍÍÍËÍÍÍËÍÍÍËÍÍÍ»'
  304. tr cp15||' \c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  305. tr cp15||' \c2º\c7³'||col(veld.1)||'³\c2º\c7³'||col(veld.2)||'³\c2º\c7³'||col(veld.3)||'³\c2º\c7³'||col(veld.4)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  306. tr cp15||' \c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  307. tr cp15||' \c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹          \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  308. tr cp15||' \c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  309. tr cp15||' \c2º\c7³'||col(veld.5)||'³\c2º\c7³'||col(veld.6)||'³\c2º\c7³'||col(veld.7)||'³\c2º\c7³'||col(veld.8)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  310. tr cp15||' \c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  311. tr cp15||' \c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹          \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  312. tr cp15||' \c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  313. tr cp15||' \c2º\c7³'||col(veld.9)||'³\c2º\c7³'||col(veld.10)||'³\c2º\c7³'||col(veld.11)||'³\c2º\c7³'||col(veld.12)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  314. tr cp15||' \c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  315. tr cp15||' \c2ÈÍÍÍÊÍÍÍÊÍÍÍÊÍÍͼ          \c4ÈÍÍÍÊÍÍÍÊÍÍÍÊÍÍͼ'
  316. end
  317. when level=2 then;do
  318. tr '1H'||cp12||'\c2ÉÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍ»          \c4ÉÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍ»'
  319. tr cp12||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  320. tr cp12||'\c2º\c7³'||col(veld.1)||'³\c2º\c7³'||col(veld.2)||'³\c2º\c7³'||col(veld.3)||'³\c2º\c7³'||col(veld.4)||'³\c2º\c7³'||col(veld.5)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  321. tr cp12||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  322. tr cp12||'\c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹          \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  323. tr cp12||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  324. tr cp12||'\c2º\c7³'||col(veld.6)||'³\c2º\c7³'||col(veld.7)||'³\c2º\c7³'||col(veld.8)||'³\c2º\c7³'||col(veld.9)||'³\c2º\c7³'||col(veld.10)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  325. tr cp12||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  326. tr cp12||'\c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹          \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  327. tr cp12||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  328. tr cp12||'\c2º\c7³'||col(veld.11)||'³\c2º\c7³'||col(veld.12)||'³\c2º\c7³'||col(veld.13)||'³\c2º\c7³'||col(veld.14)||'³\c2º\c7³'||col(veld.15)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  329. tr cp12||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  330. tr cp12||'\c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹          \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  331. tr cp12||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º          \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  332. tr cp12||'\c2º\c7³'||col(veld.16)||'³\c2º\c7³'||col(veld.17)||'³\c2º\c7³'||col(veld.18)||'³\c2º\c7³'||col(veld.19)||'³\c2º\c7³'||col(veld.20)||'³\c2º          \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  333. tr cp12||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º          \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  334. tr cp12||'\c2ÈÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍͼ          \c4ÈÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍͼ'
  335. end
  336. when level=3 then;do
  337. tr '1H'||cp5||'\c2ÉÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍ»         \c4ÉÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍ»'
  338. tr cp5||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º         \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  339. tr cp5||'\c2º\c7³'||col(veld.1)||'³\c2º\c7³'||col(veld.2)||'³\c2º\c7³'||col(veld.3)||'³\c2º\c7³'||col(veld.4)||'³\c2º\c7³'||col(veld.5)||'³\c2º\c7³'||col(veld.6)||'³\c2º\c7³'||col(veld.7)||'³\c2º         \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  340. tr cp5||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º         \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  341. tr cp5||'\c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹         \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  342. tr cp5||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º         \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  343. tr cp5||'\c2º\c7³'||col(veld.8)||'³\c2º\c7³'||col(veld.9)||'³\c2º\c7³'||col(veld.10)||'³\c2º\c7³'||col(veld.11)||'³\c2º\c7³'||col(veld.12)||'³\c2º\c7³'||col(veld.13)||'³\c2º\c7³'||col(veld.14)||'³\c2º         \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  344. tr cp5||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º         \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  345. tr cp5||'\c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹         \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  346. tr cp5||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º         \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  347. tr cp5||'\c2º\c7³'||col(veld.15)||'³\c2º\c7³'||col(veld.16)||'³\c2º\c7³'||col(veld.17)||'³\c2º\c7³'||col(veld.18)||'³\c2º\c7³'||col(veld.19)||'³\c2º\c7³'||col(veld.20)||'³\c2º\c7³'||col(veld.21)||'³\c2º         \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  348. tr cp5||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º         \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  349. tr cp5||'\c2ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹         \c4ÌÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍ͹'
  350. tr cp5||'\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º\c7ÚÄ¿\c2º         \c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º\c7ÚÄ¿\c4º'
  351. tr cp5||'\c2º\c7³'||col(veld.22)||'³\c2º\c7³'||col(veld.23)||'³\c2º\c7³'||col(veld.24)||'³\c2º\c7³'||col(veld.25)||'³\c2º\c7³'||col(veld.26)||'³\c2º\c7³'||col(veld.27)||'³\c2º\c7³'||col(veld.28)||'³\c2º         \c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º\c7³ ³\c4º'
  352. tr cp5||'\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º\c7ÀÄÙ\c2º         \c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º\c7ÀÄÙ\c4º'
  353. tr cp5||'\c2ÈÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍͼ         \c4ÈÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍͼ'
  354. end
  355. end
  356. tr '\n1        \c3R\c2=\c3Retry    N\c2=\c3New    C\c2=\c3Change Level    M\c2=\c3Main Menu    Q\c2=\c3Quit'
  357. sn '\n1          Use Cursorkeys To Move Cursor   Press \c2<\c3Enter\c2> \c3To Select'
  358. sn cursor(y,x,3)||apos(8,49)
  359. return
  360. col:
  361. select
  362. when arg(1)=1 then temp=1
  363. when arg(1)=2 then temp=3
  364. when arg(1)=3 then temp=5
  365. when arg(1)=4 then temp=6
  366. otherwise temp=7
  367. end
  368. return '\c'||temp||arg(1)||'\c7'
  369. show_instr:
  370. call clr(9)
  371. tr '\c3\n2   BrainE! is based on the Logo-clone Brain (written by Andre Wichmann).\n1'
  372. tr '   The purpose of the game is  to reproduce a randomly  generated pattern'
  373. tr '   by selecting the right squares in the right order.  When you select an'
  374. tr '   empty square all non-empty neighbours will be incremented by one.  The'
  375. tr '   numbers in the squares range from one to four.  When a square with the'
  376. tr '   number  four  is  incremented  it will become a square with the number'
  377. tr '   one.\n1'
  378. tr '   Take a look at the following example which shows what happens when you'
  379. tr '   select the square  B2  :\n2'
  380. sn cp25||'Press \c2<\c3Enter\c2> \c3to continue! '
  381. call check_carrier
  382. gc
  383. call clr(9)
  384. tr '\n2\c7                       A B C D                   A B C D'
  385. tr '                      \c4ÚÄÂÄÂÄÂÄ¿                 ÚÄÂÄÂÄÂÄ¿'
  386. tr '                    \c71 \c4³\c11\c4³\c53\c4³\c11\c4³ ³               \c71 \c4³\c11\c4³\c64\c4³\c11\c4³ ³'
  387. tr '                      \c4ÃÄÅÄÅÄÅÄ´     \c3 B2         \c4ÃÄÅÄÅÄÅÄ´'
  388. tr '                    \c72 \c4³\c32\c4³ ³\c64\c4³\c11\c4³     \c7ÍÍÍÍ>     2 \c4³\c53\c4³\c11\c4³\c11\c4³\c11\c4³'
  389. tr '                      \c4ÃÄÅÄÅÄÅÄ´                 ÃÄÅÄÅÄÅÄ´'
  390. tr '                    \c73 \c4³\c32\c4³ ³\c11\c4³ ³               \c73 \c4³\c32\c4³ ³\c11\c4³ ³'
  391. tr '                      \c4ÀÄÁÄÁÄÁÄÙ                 ÀÄÁÄÁÄÁÄÙ\n1'
  392. tr '\c3   As you can  see only  three of its four direct neighbours  change when'
  393. tr '   you  select   B2 .   The squares that are diagonally next to  B2  (A1,'
  394. tr '   C1, A3, C3) are not considered as neighbours of  B2  and are therefore'
  395. tr '   not  incremented.   The  neighbour   B3  is empty so that square isn t'
  396. tr '   incremented either!\n2'
  397. sn cp25||'Press \c2<\c3Enter\c2> \c3to continue! '
  398. call check_carrier
  399. gc
  400. call clr(9)
  401. tr '\n2   When you have correctly reproduced the randomly generated pattern, the'
  402. tr '   time needed  to solve  the puzzle will  be showed.  Your  name will be'
  403. tr '   added to the highscore-list when you have a top ten score!\n1'
  404. tr '   The game is  actually quite simple. Just play a few games and you will'
  405. tr '   see this for yourself.\n1'
  406. tr '   You  can  select  three  different  levels  of  difficulty.   The only'
  407. tr '   difference  between  these three levels is the size of the grid.  Each'
  408. tr '   level has its own highscore-list.\n1'
  409. tr '                               Enjoy the game!\n2'
  410. sn cp25||'Press \c2<\c3Enter\c2> \c3to continue! '
  411. call check_carrier
  412. gc
  413. return
  414. show_hiscore:
  415. call clr(9)
  416. tr '\n1'||cp15||'\c3    \z2ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·\z0'
  417. tr cp15||'    \z2º \z0                                  \z2 º\z0'
  418. tr cp15||'    \z2º \z0        H I G H S C O R E S       \z2 º\z0'
  419. tr cp15||'    \z2º \z0                                  \z2 º\z0'
  420. tr cp15||'    \z2º \z0            L E V E L  '||level||'          \z2 º\z0'
  421. tr cp15||'    \z2º \z0                                  \z2 º\z0'
  422. tr cp15||'    \z2ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ\z0'
  423. tr cp15||'    \z2º \z0                                  \z2 º\z0'
  424. do i=1 for 10
  425. if new_hiscore=1&i=player then kleur='\c7'
  426. else kleur='\c3'
  427. tr cp15||'    \z2º \z0'||kleur||right(i,3)||'. '||left(alias.i,25,'.')||right(score.i,3)||' \z2\c3 º\z0'
  428. end
  429. tr cp15||'    \z2º \z0                                  \z2 º\z0'
  430. tr cp15||'    \z2ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\z0\n1'
  431. return
  432. show_main:
  433. call clr(9)
  434. tr '1H'||cp25||'\c2ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·'
  435. tr cp25||'º    M A I N   M E N U    º'
  436. tr cp25||'ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ'
  437. tr cp25||'º 0. \c3Start Game \c2(level '||level||') \c2º'
  438. tr cp25||'º 1. \c3Show Instructions    \c2º'
  439. tr cp25||'º 2. \c3Show Highscores      \c2º'
  440. tr cp25||'º 3. \c3Change Level         \c2º'
  441. tr cp25||'º 4. \c3Quit Game            \c2º'
  442. tr cp25||'ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ'
  443. tr cp25||'º     Make a choice:      º'
  444. tr cp25||'ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\c3'
  445. sn '47H'
  446. return
  447. show_header:
  448. tr '\f1\@6'
  449. tr cp15||'\c3ÛÛÛÛÛÛ\c7¿ \c3ÛÛÛÛÛÛ\c7¿  \c3ÛÛÛÛÛ\c7¿ \c3ÛÛ\c7¿\c3ÛÛÛ\c7¿ \c3ÛÛ\c7¿\c3ÛÛÛÛÛÛÛ\c7¿\c3ÛÛ\c7¿'
  450. tr cp15||'\c3\z2²²\c7\z0ÚÄÄ\c3\z2²²\c7\z0¿\c3\z2²²\c7\z0ÚÄÄ\c3\z2²²\c7\z0¿\c3\z2²²\c7\z0ÚÄÄ\c3\z2²²\c7\z0¿\c3\z2²²\c7\z0³\c3\z2²²²²\c7\z0¿\c3\z2²²\c7\z0³\c3\z2²²\c7\z0ÚÄÄÄÄÙ\c3\z2²²\c7\z0³'
  451. tr cp15||'\c3\z2±±±±±±\c7\z0ÚÙ\c3\z2±±±±±±\c7\z0ÚÙ\c3\z2±±±±±±±\c7\z0³\c3\z2±±\c7\z0³\c3\z2±±\c7\z0Ú\c3\z2±±±±\c7\z0³\c3\z2±±±±±\c7\z0¿  \c3\z2±±\c7\z0³'
  452. tr cp15||'\c3\z2°°\c7\z0ÚÄÄ\c3\z2°°\c7\z0¿\c3\z2°°\c7\z0Ú\c3\z2°°\c7\z0ÚÙ \c3\z2°°\c7\z0ÚÄÄ\c3\z2°°\c7\z0³\c3\z2°°\c7\z0³\c3\z2°°\c7\z0³À\c3\z2°°°\c7\z0³\c3\z2°°\c7\z0ÚÄÄÙ  ÀÄÙ'
  453. tr cp15||'\z2      \z0ÚÙ\z2  \z0³À\z2  \z0¿ \z2  \z0³  \z2  \z0³\z2  \z0³\z2  \z0³ À\z2  \z0³\z2       \z0¿\z2  \z0¿'
  454. tr cp15||'ÀÄÄÄÄÄÙ ÀÄÙ ÀÄÙ ÀÄÙ  ÀÄÙÀÄÙÀÄÙ  ÀÄÙÀÄÄÄÄÄÄÙÀÄÙ'
  455. tr cp5||cp25||'\c3v1.0  by Morpheus'
  456. return
  457. change_level:
  458. call clr(9)
  459. tr '1H'||cp25||'  \c2ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·'
  460. tr cp25||'  º    Change Level    º'
  461. tr cp25||'  ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ'
  462. tr cp25||'  º 1. \c3Level 1 (4 x 3) \c2º'
  463. tr cp25||'  º 2. \c3Level 2 (5 x 4) \c2º'
  464. tr cp25||'  º 3. \c3Level 3 (7 x 4) \c2º'
  465. tr cp25||'  ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ'
  466. tr cp25||'  º  Make a choice:    º'
  467. tr cp25||'  ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ\c3'
  468. sn '46H'
  469. call check_carrier
  470. gc
  471. temp=result
  472. sn temp
  473. select
  474. when temp=1 then;do
  475. level=1
  476. x_tot=4
  477. y_tot=3
  478. totaal=12
  479. end
  480. when temp=2 then;do
  481. level=2
  482. x_tot=5
  483. y_tot=4
  484. totaal=20
  485. end
  486. when temp=3 then;do
  487. level=3
  488. x_tot=7
  489. y_tot=4
  490. totaal=28
  491. end
  492. otherwise nop
  493. end
  494. call read_hiscore(level)
  495. return
  496. gen_veld:
  497. do i=1 for totaal
  498. veld.i=0
  499. end
  500. i=1
  501. do while i<=totaal
  502. nr=1+rnd(totaal)
  503. if veld.nr=0 then;do
  504. j=i//4
  505. select
  506. when j=0 then sn '|\<1'
  507. when j=1 then sn '/\<1'
  508. when j=2 then sn '-\<1'
  509. when j=3 then sn '\\\<1'
  510. end
  511. veld.nr=1
  512. i=i+1
  513. if nr>x_tot then;do
  514. temp=nr-x_tot
  515. if veld.temp>0 then veld.temp=1+(veld.temp//4)
  516. end
  517. if nr<=(totaal-x_tot) then;do
  518. temp=nr+x_tot
  519. if veld.temp>0 then veld.temp=1+(veld.temp//4)
  520. end
  521. if (nr//x_tot)~=1 then;do
  522. temp=nr-1
  523. if veld.temp>0 then veld.temp=1+(veld.temp//4)
  524. end
  525. if (nr//x_tot)~=0 then;do
  526. temp=nr+1
  527. if veld.temp>0 then veld.temp=1+(veld.temp//4)
  528. end
  529. end
  530. end
  531. return
  532. rnd:
  533. return (random(1,100,time(s))+random(1,100,time(s))+random(1,100,time(s)))//arg(1)
  534. check_carrier:
  535. getcarrier
  536. if result='FALSE' then exit
  537. return
  538. quit_game:
  539. bbsidentify name
  540. bbsname=result
  541. sn '\f1\n3\c2'center('Returning to '||bbsname||'...',78)||'\n1\w1\q1'
  542. setlength maxlines
  543. exit
  544. clr:
  545. sn ''arg(1)'H'
  546. return
  547. apos:
  548. return ''arg(1)';'arg(2)'H'
  549. cursor:
  550. return ''arg(1)';'arg(2)'H\c'arg(3)'ÚÄ¿\!1\<3³\>1³\!1\<3ÀÄÙ'